/**
 * 
 */
package hs4m.kidseducational.util;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

/**
 * @author MinhVT
 * 
 */
public class Preference {

	private final String URI = "hs4m.kidseducational.utils.Preference";
	private final String STAR = "star";
	private final String SOUND = "sound";
	private SharedPreferences mPrefs;

	public Preference(Context context) {
		mPrefs = context.getSharedPreferences(URI, 0);
	}

	// Star
	public String getStar() {
		return mPrefs.getString(STAR, null);
	}

	public void setStar(String star) {
		Editor editor = mPrefs.edit();
		editor.putString(STAR, star);
		editor.commit();
	}

	// Sound
	public boolean getSound() {
		return mPrefs.getBoolean(SOUND, false);
	}

	public void setSound(boolean sound) {
		Editor editor = mPrefs.edit();
		editor.putBoolean(SOUND, sound);
		editor.commit();
	}
}
